package top.zackyoung.springboot.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;
import top.zackyoung.springboot.mapper.JavaUserMapper;
import top.zackyoung.springboot.entity.JavaUser;
import top.zackyoung.springboot.jpa.JavaUserDao;
import top.zackyoung.springboot.service.JavaUserService;

import javax.annotation.Resource;
import java.util.Optional;

/**
 * @author ZackYoung
 * @version 1.0
 * @description
 * @date 2021/5/16 11:25
 */
@Service
public class JavaUserServiceImpl  extends MPJBaseServiceImpl<JavaUserMapper,JavaUser> implements JavaUserService {
    @Resource
    JavaUserDao javaUserDao;
    @Resource
    JavaUserMapper javaUserMapper;

    @Override
    public Optional<JavaUser> getById(Long id) {
        return javaUserDao.findById(id);
    }

    @Override
    public Optional<JavaUser> getByIdMP(Long id) {
        return Optional.ofNullable(javaUserMapper.selectById(id));
    }
}
